/********************************** (C) COPYRIGHT  *******************************
* File Name          : rtc.h
* Author             : Neo-T
* Version            : V1.0.0
* Date               : 2023/08/13
* Description        : This file contains all the functions prototypes for all RTC
*                      operations
*********************************************************************************/
#ifndef _RTC_H
#define _RTC_H

#ifdef __cplusplus
extern "C" {
#endif

#ifdef SYMBOL_GLOBALS
   #define RTC_EXT
#else
   #define RTC_EXT extern
#endif //* SYMBOL_GLOBALS

typedef struct _ST_DATETIME_ {
    USHORT usYear;
    UCHAR ubMonth;
    UCHAR ubDay;
    UCHAR ubHour;
    UCHAR ubMin;
    UCHAR ubSec;
    UCHAR ubWeekDay;
} ST_DATETIME, *PST_DATETIME;

RTC_EXT UCHAR RTCInit(void);
RTC_EXT void RTCSetSysTime(USHORT usYear, UCHAR ubMonth, UCHAR ubDay, UCHAR ubHour, UCHAR ubMin, UCHAR ubSec);
RTC_EXT void RTCSetSystemUnixTimestamp(time_t tUnixTimestamp);
RTC_EXT void RTCGetSysTime(PST_DATETIME pstDateTime);
RTC_EXT time_t UnixTimestamp(PST_DATETIME pstDateTime);
RTC_EXT void UnixTimeToLocalTime(time_t tUnixTimestamp, CHAR *pszDatetime);
RTC_EXT time_t Time(void);

#ifdef __cplusplus
}
#endif //* #ifdef __cplusplus

#endif //* #ifndef _RTC_H



